package com.imooc.springcloud;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @desc
 * @author zkw
 * @date 2021-03-28
 */
@RestController
@RequestMapping("/refresh")
@RefreshScope
public class RefreshController {
    @Value("${info.words}")
    private String words;

    @Value("${info.pwd}")
    private String pwd;

    @GetMapping("/words")
    public String getWords() {
        return words;
    }

    @GetMapping("/pwd")
    public String getPwd() {
        return "pwd：" + pwd;
    }
}
